package mapper.UserMapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import entity.User;

//import省略
@Repository
public interface UserMapper {
	@Update("update User set icon=#{icon},password=#{password} where userId=#{userId}")
	public int updateUserIcon(String icon,String userId);

    @Select("select * from User where userId=#{userId} and passWord=#{passWord} ")
    public User findUser(User user);

	@Insert("insert into users(username,password) values(#{username},#{password})")
	public int addUser(User user);

//	@Delete("delete from users where id=#{id}")
//	public int deleteUser(int id);
//
//
//
//	@Select("select * from User where id=#{userId}")
//	public User getUserById(int id);
//


	@Select("select * from users where username=#{username}")
	public User findUserByUserName(String username);
//
//	@Select("select * from users")
//	public List<User> getAllUsers();
}